package sponsor;

import java.util.ArrayList;
import java.util.List;

/**
 * This class manages all the attributes and methods related to the Sponsor
 * like: - Insert a video from sponsor - Delete a video from sponsor - Change
 * the name of the sponsor - Change the type of the sponsor - Change the monthly
 * of the sponsor
 * 
 * @author Cassio Espindola
 * 
 */
public class Sponsor {

	private String name;
	private double monthly;
	private List<String> videos;
	private String type;
	private double currentDuration;

	/**
	 * Sponsor's Constructor
	 * 
	 * @param name
	 *            - Name of the Sponsor
	 * @param monthly
	 *            - Monthly
	 * @param type
	 *            - The type of the sponsor
	 * @throws Exception
	 *             - If a name or a monthly passed is null or equals to empty
	 *             String
	 */
	public Sponsor(String name, String type, double monthly) throws Exception {
		if (name == null || name.equals("")) {
			throw new Exception("Entrada Invalida!");
		} else if (monthly < 0) {
			throw new Exception("Mensalidade deve ser um valor maior do que 0!");
		} else {
			this.name = name;
			this.setType(type);
			this.monthly = monthly;
			this.videos = new ArrayList<String>();
			this.currentDuration = 0;
		}
	}

	/**
	 * Returns the name of the sponsor
	 * 
	 * @return name - Name of the sponsor
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name of the sponsor
	 * 
	 * @param name
	 *            - New name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Returns the monthly of the sponsor
	 * 
	 * @return monthly - Current monthly
	 */
	public double getMonthly() {
		return monthly;
	}

	/**
	 * Sets the monthly of the sponsor
	 * 
	 * @param monthly
	 *            - New Monthly
	 */
	public void setMonthly(double monthly) {
		this.monthly = monthly;
	}

	/**
	 * Sets the type of the sponsor
	 * 
	 * @param type
	 *            - The type may be silver, gold or platinum
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * Returns the current type of the sponsor
	 * 
	 * @return type - The type may be silver, gold or platinum
	 */
	public String getType() {
		return type;
	}

	/**
	 * Returns a list that contains the videos belongs to the sponsor
	 * 
	 * @return videos - List of videos
	 */
	public List<String> getVideos() {
		return videos;
	}

	/**
	 * Gets the duration of all videos belongs to sponsor
	 * 
	 * @return currentDuration
	 */
	public double getCurrentDuration() {
		return currentDuration;
	}

	/**
	 * 
	 * @param currentDuration
	 */
	public void setCurrentDuration(double currentDuration) {
		this.currentDuration = currentDuration;
	}
}